"""
绘制函数 f(x)=sin2(x−2)e−x2
需要画出标题，x，y轴。x的取值范围是[0, 2]
"""
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 2, 100)
y = (np.sin(x - 2)) ** 2 * np.exp(-1 * x ** 2)
plt.title(r'$sin^2(x−2)e^{-x^2}$')
plt.xlabel('x label')
plt.ylabel('y label')
plt.plot(x, y)
plt.show()
